﻿@model List<BDShop.Entities.ProductCacheComplex>
@using BDShop.Configuration
@using BDShop.Library.Extensions
@using BDShop.Utilities.Managers

<div class="box">
        <div class="box-heading">MỚI NHẤT</div>
        <div class="box-content">
            <div class="box-product">
                <div class="flexslider">
                    <ul class="slides">
                         @foreach (var product in Model)
                         {
                             string[] categoryDefinition = null;
                             if (!string.IsNullOrEmpty(product.CategoryDefinition))
                             {
                                 categoryDefinition = product.CategoryDefinition.Split('|')[0].Split('#');
                             }
                             var url = UrlManager.ProductDetailUrl(product.ID, product.Name, categoryDefinition);
                             <li>
                                 <div class="slide-inner">
                                     <div class="image">
                                         <a href="@url">
                                             <img style="width:45px" class="lazy" data-original="@Path.Combine(BDShopConfiguration.Storage.MainImagePath,product.MainImage)" src="@Path.Combine(BDShopConfiguration.Storage.MainImagePath,product.MainImage)" alt="@product.Name" /></a>
                                     </div>
                                     <div class="name"><a href="@url">@product.Name</a></div>
                                     <div class="price">@product.Price.ToCurrencyString(false,true)</div>
                                     <div class="clear"></div>
                                 </div>
                             </li>
                         }
                    </ul>
                </div>
            </div>
        </div>
    </div>